The present invention relates in general to data processing systems, and in particular, to a method, system and computer program product for operating a trace procedure, which traces execution of a computer program in a trace buffer.
Tracing is used in computer programs to log the program execution flow. This is important if failures have to be analyzed in a “post mortem” scenario. Tracing can also be used in a production environment for problem determination. In the production environment, a problem may occur with the code (e.g. code paths, code path sequences that were abnormal or unexpected), the input data (e.g. values that are incorrect, out of range or unexpected) or the general computing environment (lack of memory, central processing unit (CPU) cycles, Direct Access Storage Device (DASD), or network throughput).
When storage space matters (no HD, memory only systems, ring buffer, etc.), a question arises as to how many trace statements should be included. Many traces result in a large amount of data, whereas less traces result in less information available for analysis.
Trace data can be limited in a variety of ways. The user may limit the number of trace points and/or the amount of state data saved at each trace point to reduce the total volume of collected data. Alternatively or additionally, a trace buffer may hold a limited volume of most recently gathered trace data, older data being overwritten as new trace data is accumulated. This is normally the case when a ring buffer is used for storing trace information, which is one way of gathering trace information.